package com.thingple.settings;

import android.util.Log;

import com.thingple.shared_context.SharedContext;

/**
 *
 * Created by lism on 2017/8/18.
 */
public class PreferencesUtils {

    public static int getHighPower() {
        String key = "reader_hight_power";
        int power = 0;
        try {
            String value = SharedContext.shareInstance().get(key);
            int val = Integer.parseInt(value);
            if (val > 0) {
                power = val;
            }
        } catch (Exception e) {
            Log.e("", "转换" + key + "时异常", e);
        }

        return power;
    }

    public static int getLowPower() {
        String key = "reader_low_power";
        int power = 0;
        try {
            String value = SharedContext.shareInstance().get(key);
            int val = Integer.parseInt(value);
            if (val > 0) {
                power = val;
            }
        } catch (Exception e) {
            Log.e("", "转换" + key + "时异常", e);
        }

        return power;
    }
}
